//
// Description: 190. 颠倒二进制位
// Created by Loading on 2025/4/1.
//

#include <bits/stdc++.h>

using namespace std;

uint32_t reverseBits(uint32_t n) {
    uint32_t res = 0;

    for (int i = 0; i < 32 && n > 0; ++i) {
        // 逐位颠倒
        res |= (n & 0x01) << (31 - i);
        n >>= 1;
    }

    return res;
}

int main() {
    uint32_t n = 0b00000010100101000001111010011100;

    auto res = reverseBits(n);

    cout << res << endl;

    return 0;
}
